home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 2 / Deutsche Edition 2.iso / mac / DISKETTEN⁄FESTPLATTEN / sAVe the Disk 1.4.2 / Read Me next >
Text File  |  1994-06-18  |  17KB  |  326 lines

  1. sAVe the Disk 1.4.2
  2. -------------------
  3.  
  4. Overview
  5.  
  6. sAVe the Disk 1.4.2 is a FreeWare system extension (aka INIT) which will
  7. alleviate the excessive disk drive hits experienced by owners of AV Macs
  8. in the following circumstances:
  9.  
  10. 1) Several Resource Manager operations flush the whole file to disk each
  11.    time the length of a resource file is changed. This significantly degrades
  12.    performance if many such changes occur in succession, e.g. while linking
  13.    programs, using ResEdit or running resource compilers.
  14.  
  15. 2) The disk cache built into the system writes back more data than necessary
  16.    when flushed. This does not affect proper operation of the disk cache (nor
  17.    does it help it :^) but results in superfluous disk activity and thus a slow
  18.    down of file operations.
  19.  
  20. 3) Each time a sound channel is allocated (disposed) some information is read
  21.    from (written to) the file DSP Preferences. Applications which follow Apple's
  22.    recommendations create and destroy such a channel for each single sound they
  23.    produce and thus slow down while they torture your harddisk. This problem
  24.    becomes most obvious with games.
  25.    
  26. Note that the extension AV Speedup 1.0 (developed by Matt Gough and Brian Stroud)
  27. addresses only the first set of problems. AV Resource Manager Tuner and AV Cache
  28. Tuner (by Steve Kiene, MindVision Software) improve the Resource Manager and the
  29. disk cache respectively. Their functionality has been integrated into sAVe the
  30. Disk, which adds a solution for the sound related disk trashing, too.
  31.  
  32. Version 1.2 of the System Enabler 088 does also fix the Resource Manager as well
  33. as the disk cache problems. However sAVe the Disk 1.4.2 will still improve the
  34. performance of the Sound Manager in this configuration.
  35.  
  36.  
  37. Installation
  38.  
  39. Simply drop the sAVe the Disk extension onto the icon of the closed system
  40. folder and let the Finder place it in the Extensions folder. Then restart your
  41. machine. sAVe the Disk 1.4.2 will load and display its icon while it installs
  42. itself during start-up.
  43.  
  44. You should also remove your other AV Mac tuning extensions like
  45. AV Resource Manager, AV Cache Tuner or AV Speedup: sAVe the Disk 1.4.2 replaces
  46. them all. Leaving them active will cause no harm (but no additional benefits
  47. either), it will only become difficult to tell which extension finally remains
  48. operative.
  49.  
  50.  
  51. Does it work?
  52.  
  53. The following is a simple way to test if sAVe the Disk is operating properly. In
  54. the Finder select Page Setup from the File menu and click _outside_ the dialog
  55. box several times. The system beep should sound for each click. However disk
  56. activity should only occur prior to the first beep when the actual sound data is
  57. read from its resource inside the system file. There should be no disk hits for
  58. the repeated sounds. Compare this with the ongoing disk accesses before you
  59. installed sAVe the Disk. Now you could enjoy one of your former favorite games
  60. without disk noise and without jerky delays degrading animation.
  61.  
  62.  
  63. If it doesn't work
  64.  
  65. As sAVe the Disk uses less than 2k of system memory plus the size of your DSP
  66. Preferences file (usually less than 0.5k), there should always be sufficient
  67. memory available.
  68.  
  69. Other possible problems include:
  70.  
  71. - the ROM version is not 1917 (0x770), e.g. you are trying to install sAVe on a
  72.   non-AV Mac. Don't do that, sAVe provides no benefits on non-AV Macs.
  73.   
  74. - your DSP Preferences file is either corrupt or incompatible with the type of
  75.   AV Mac (660/840) you are using and cannot be deleted. Unprotect or delete the
  76.   file manually.
  77.  
  78. - the file DSP Preferences uses a newer format which sAVe does not recognize.
  79.   Since the format of this file is not documented (only the system calls to
  80.   store/retrieve info) Apple is free to change it. There might be an updated
  81.   version of sAVe available or you could trash the newer prefs file and let sAVe
  82.   maintain the info in the older format. Try this at your own risk!
  83.  
  84. No icon will be displayed during start-up and no changes to the system will be
  85. made, if any of the above problems prevents proper installation.
  86.  
  87. I developed and tested sAVe the Disk on my Centris/Quadra 660av running System
  88. 7.1 and version 1.2 of the System Enabler 088, but it is known to work on a
  89. Quadra 840av, too. Some additional testing has been done older Enablers.
  90. Although it has not caused me any trouble I'm not responsible for any (unlikely)
  91. problems you may experience.
  92.  
  93. Please note that sAVe the Disk does _not_ fix the problems with games which
  94. write to the (on the AV Macs nonexistent) Apple Sound Chip directly and
  95. therefore produce no sound at all. You should contact the publisher of such
  96. software and ask for a fix or update.
  97.  
  98. Feel free to contact me at the address given below if you encounter any problems
  99. related to sAVe the Disk 1.4.2.
  100.  
  101.  
  102. Known Problems
  103.  
  104. sAVe the Disk works differently than the original system code, if the size of
  105. the preference data associated with a given selector changes. This should cause
  106. no trouble however, because the original code simply corrupts the prefs file :^)
  107.  
  108. If you experience problems with the Photoshop DSP plug-in, remember that all
  109. existing version of RamDoubler (latest version is 1.0.2) are incompatible with
  110. this plug-in. As far as I know sAVe the Disk does not cause the freezes.
  111.  
  112.  
  113. How does it work?
  114. (optional reading)
  115.  
  116. 1) Resource Manager
  117.  
  118.    FlushFile is head-patched to ignore all calls from the Resource Manager. It
  119.    checks its return address on the stack against the location of the FlushFile
  120.    call inside the Resource Manager routines in ROM. As this won't work if
  121.    somebody tail-patched FlushFile, the patch will also search through the chain
  122.    of open resource files maintained by the Resource Manager and will keep all
  123.    members from getting flushed. However a flag is set/cleared by a patch to
  124.    UpdateResFile which will cause all FlushFile calls from inside UpdateResFile
  125.    to be still performed. Thus UpdateResFile (and CloseResFile which calls
  126.    UpdateResFile) still flush the file to disk to ensure data integrity in case
  127.    of a system crash. The new patching scheme is simpler than that used by
  128.    previous versions of sAVe and keeps additional Resource Manger calls
  129.    (SetResInfo, SetResAttrs) from flushing the file to disk each time, resulting
  130.    in a significant performance gain while basically keeping the same level of
  131.    data security. As a side effect revert-type commands in ResEdit should work
  132.    now (at least more often than before).
  133.  
  134. 2) Disk Cache
  135.  
  136.    The FlushCache trap (0xA0C0) is augmented with an additional check, which
  137.    keeps cached disk blocks from getting written back in situations where the
  138.    File System is simply iterating over nodes in the catalog. An additional
  139.    check, which causes sectors to be always written out, was introduced to work
  140.    around a bug in the Mac Plus ROMs. This resulted in a slow down of some
  141.    operations, but made the File System work reliable. When the check for that
  142.    ancient ROM bug was removed in the AV ROMs, the code probably got mixed up
  143.    and was changed to again always write sectors back to disk. The patched trap,
  144.    however, will honor the bug-free ROMs (at least in this respect) and skip
  145.    the write back whenever possible.
  146.  
  147. The above two sets of patches are only applied if a version of the System
  148. Enabler 088 older than 1.2 is present, otherwise sAVe the Disk lets the Enabler
  149. fix these parts of the system.
  150.  
  151. 3) DSP Preferences
  152.  
  153.    Two subfunctions of the DSPDispatch trap (ABF5) access the file DSP
  154.    Preferences inside the Preferences folder and cause the sound related disk
  155.    hits (selector 0x121 to read info, 0x5F to update the info). Both
  156.    subfunctions are replaced by entirely new routines modelled after the
  157.    originals. The contents of the DSP Preferences are read into a relocatable
  158.    block inside the system heap during start-up. Accesses to preference data
  159.    just read the info from memory, update it in memory or grow the block and
  160.    append new information. A shutdown handler will finally update the file on
  161.    disk (if any info was added/updated) before you restart or shutdown your
  162.    Macintosh. This should cause no problems as the DSP Preferences file is small
  163.    (usually less than 500 bytes) and the updated information records past DSP
  164.    performance data as an estimate for future uses. Thus it is no real problem
  165.    if a system crash should keep the data from getting written back. The
  166.    estimates used will just be slightly less accurate as they result from older
  167.    measurements.
  168.    
  169.    Another subfunction of the DSPDispatch trap is used to repeatedly read a
  170.    resource of type 'dspf' from the System Enabler 088 and will DetachResource
  171.    in order to return a non-resource handle to its caller. Thus the resource
  172.    data is read from disk each time, still resulting in sound related disk
  173.    trashing under the 1.0 Enabler. With the 1.1 Enabler the system's disk cache
  174.    was usually able to prevent actual disk access. A head-patch to the
  175.    DSPGetResource subfunction (0x124) will handle requests for resources of type
  176.    'dspf' and use HandToHand in order to copy the requested data into a new
  177.    non-resource handle. The original resource handle is marked purgable so that
  178.    its 4.5k can be reclaimed if the system runs out of memory (the resource will
  179.    be reread from disk the next time it is accessed). For resource types other
  180.    than 'dspf' and in case of any error the patch invokes the original ROM code.
  181.    The ROM code seems to support an additional special resource file, which is
  182.    examined if a request can't be satisfied by the currently open files.
  183.    Although this feature appears to be currently unused, the fallback to the
  184.    original routine should guarantee 100% compatibility.
  185.  
  186. If you want to trash your DSP Preferences file because it has grown too large,
  187. proceed as follows: restart your Mac and put the file into the trash before any
  188. sound is produced (except the usual noise at start-up). Hold down the SHIFT-key
  189. during start-up to prevent other extensions from accessing the Sound Manager
  190. before the Finder has been started, if required. Restart your Mac again, when
  191. the file has been trashed. After the first sound has been played the data kept
  192. in memory is updated and will be completely rewritten at shutdown (or prior to
  193. a restart) even if you trashed the prefs file.
  194.  
  195.  
  196. The Original Note on 840AV Disk-Trashing
  197. (as distributed with AV Speedup 1.0)
  198.  
  199. There are at least two serious disk-related bugs in the 840AV, which have been
  200. verified by DTS:
  201.  
  202. 1) ChangedResource now flushes the resource's entire file out to disk.  This is
  203. first noticeable during a System install, when the Installer will take several
  204. minutes to construct the System file.  But it is most heinous during MPW Rez
  205. and Link.  My project takes 5 to 10 times longer to build (than on an 800)
  206. because the entire file is written to disk hundreds or thousands of times in
  207. rapid succession as each resource is added to my app.  Of course, this bug will
  208. make any program run slower if it adds, changes or deletes resources.
  209.  
  210. 2) SndDisposeChannel will hit the disk for some retarded reason.  Apple says
  211. the DSP chip is behind this.  Every time a system beep is played, for example,
  212. you'll notice a couple of "ca-chunks" from your hard disk.  This is especially
  213. harsh on sound-intensive applications (like games).  Many games slow down to a
  214. jerky crawl because they typically call SndDisposeChannel after each sampled
  215. sound completes.  The workaround is to leave a sound channel open and reuse
  216. it for each sampled sound until you quit or suspend your app.
  217.  
  218. Apple DTS classifies these bugs as "goofinesses", and currently offers no plans
  219. to fix them.
  220.  
  221. Todd Ouzts
  222.  
  223. Author: DAYNA
  224.  
  225.  
  226. Many Thanks To...
  227.  
  228. Dave Schutz for the original icon (taken from his Colossal Icons collection).
  229. Otherwise sAVe the Disk would have to go with the default icon for system
  230. extensions and would have no super hero to stand behind its noble aim.
  231.  
  232. Kurt Wiley for the modified icons which add the conformant look of a system
  233. extension to sAVe the Disk.
  234.  
  235. Matt Gough and Brian Stroud who brought the Resource Manager deficiencies to my
  236. attention and made me put my vague ideas about a solution to the sound problem
  237. into actual code. From their AV Speedup distribution I got to know that there
  238. was no point in waiting for a fix from DTS (see note above).
  239.  
  240. Steve Kiene who suggested a simpler and more effective solution for the Resource
  241. Manager problems and inspired the addition of the disk cache fix. Check out his
  242. AV Turbo ROM control panel, if you want to see your AV Mac run faster than ever
  243. before (and you have 2 Megs of RAM to spare :-(). He provided some insights on
  244. the nature of the disk cache bug, too.
  245.  
  246. Malcolm Slaney from the ATG Perception Group who made the source to the DSP
  247. related application VUMeter publicly available. The included headers shed some
  248. light onto the DSP trap interface and turned mysterious entities into
  249. comprehensible data structures.
  250.  
  251. Patrick C. Beard who placed his ShowIconFamily code in the public domain. He
  252. made the successful installation of sAVe the Disk visible.
  253.  
  254.  
  255. Legal Stuff
  256.  
  257. sAVe the Disk 1.4.2 is provided free of charge but remains copyright Michael
  258. Thies. It may not be sold for profit but may otherwise be distributed freely in
  259. unmodified form and complete with this unaltered documentation. It may be
  260. included with ShareWare or commercial products, if I have been informed of the
  261. intended bundling in advance and it is made clear that sAVe the Disk itself
  262. comes free of charge and does not form part of the actual product sold.
  263.  
  264. sAVe the Disk 1.4.2 is provided in the hope that it will be useful but comes
  265. with _absolutely_ NO warranty.
  266.  
  267. It was developed with THINK C 7.0 (free upgrade from 6.0.1) so parts of it may be
  268. Copyright Symantec Corporation.
  269.  
  270. Several terms used above are trademarks of their respective holders.
  271.  
  272.  
  273. Version History
  274.  
  275. 1.0    11/23/93    Initial Version
  276. 1.1    11/25/93    - fixed bug which could prevent access to prefs file
  277.                    - UpdateGPBPrefFile subfunction will read prefs file into
  278.                      memory, if GetGPBModes was never called before
  279.                    - Resource Manager patches are more robust. Even in case of
  280.                      errors no call to FlushFile should get accidently ignored.
  281.                    - Icon gets displayed during start-up if installation
  282.                      successful
  283.                    - fine-tuned code
  284. 1.1.1  12/04/93    - added compatibility with version 1.0 of the System Enabler
  285.                      (additional work will be needed to prevent ALL disk
  286.                       trashing with the 1.0 Enabler)
  287.                    - more work done at installation time => less resident code
  288. 1.2    12/05/93    - work around for 1.0 Enabler added: no more disk trashing
  289.                    - no reliance on systems's disk cache with any Enabler
  290.                    - resident code nearly back to old (v1.1) size :-(
  291. 1.2.1  12/07/93    - create copy of 'dspf' resource in heap zone where resource
  292.                      was loaded (application vs. system heap)
  293. 1.3    12/18/93    - prefs file read at start-up => less resident code
  294.                    - take full advantage of sys 7 file specs => even less code
  295.                    - simpler, better, faster Resource Manager patch
  296.                    - added disk cache patch
  297.                    - more reliable if new prefs settings are to be added while
  298.                      system heap cannot grow
  299.                    - improved icons
  300. 1.3.1  01/05/94    - tail-patches to FlushFile no longer disable Resource Manager
  301.                      patch (more reliable but slower secondary test added)
  302.                    - only FlushFile calls from inside UpdateResFile are honored
  303.                      (and calls from outside the Resource Manager)
  304.                    - sensible behaviour if size of prefs data associated with a
  305.                      given selector changes
  306.                    - stream-lined balloon help
  307. 1.3.2  02/15/94    - icon plotting during start-up takes advantage of sys 7 icon
  308.                      families
  309.                    - special debug mode added, rename extension to "sAVe %"
  310. 1.3.3  04/30/94    - disk cache patch works even if the relevant trap has already
  311.                      been patched by other extensions
  312. 1.4    05/22/94    - recognizes 1.2 Enabler and suppresses redundant patches
  313.                    - removed debug mode
  314. 1.4.1  05/29/94    - better error checking added, when determining version of
  315.                      System Enabler
  316. 1.4.2  06/18/94    - fixed strange bug, where sAVe hung during start-up with the
  317.                      1.0 and 1.1 Enabler
  318.  
  319. I am always interested in comments, suggestions and bug reports (sigh).
  320.  
  321. -------------------------------------------------------
  322. Michael Thies            (thiesana@uni-paderborn.de)
  323. Fachbereich Informatik
  324. Universitaet-Gesamthochschule Paderborn
  325. Germany
  326.